<div class="primary">
   <div class="wrap">
      <?php include ROOT.'/home/view/view_bar.php'?>
      <div class="breadcrumb">
         <span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
            <a itemprop="url" rel="up" class="crumb" href="/"><span itemprop="title">Trang chủ</span></a>
            <span class="arrow"> &gt; </span>
         </span>
         <span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
            <a itemprop="url" rel="up" class="crumb" href="/may-tinh-bang/"><span itemprop="title">Máy tính bảng</span></a>
            <?=$curr_cat != '' ? '<span class="arrow"> &gt; </span>' : ''?>
         </span>
         <?
         if($curr_cat != '') {
         ?>
         <span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
            <a itemprop="url" rel="up" class="crumb" href="/may-tinh-bang-<?=$curr_cat['cat_alias']?>/"><span itemprop="title"><?=$curr_cat['cat_name']?></span></a>
         </span>
         <?
         }
         ?>
      </div>
      <div class="products_wrap">
         <div class="filter_wrap">
            <ul class="filter">
               <li class="first-li">Tìm theo <i class="icon-arrfilter"></i></li>
               <li>
                  <a href="javascript:;">Mức giá<span class="arrdown"></span></a>
                  <ul class="dropfilter">
                     <li>
                        <a<?=$filter_price == '' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Tất cả</a>
                        <a<?=$filter_price == 'duoi-1-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=duoi-1-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 1 triệu</a>
                        <a<?=$filter_price == 'duoi-2-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=duoi-2-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 2 triệu</a>
                        <a<?=$filter_price == 'duoi-3-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=duoi-3-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 3 triệu</a>
                        <a<?=$filter_price == 'duoi-5-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=duoi-5-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 5 triệu</a>
                        <a<?=$filter_price == 'duoi-8-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=duoi-8-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 8 triệu</a>
                        <a<?=$filter_price == 'duoi-10-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=duoi-10-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 10 triệu</a>
                        <a<?=$filter_price == 'tren-10-trieu' ? ' class="checked"' : ''?> href="<?=$current_url?>?gia=tren-10-trieu<?=$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Trên 10 triệu</a>
                     </li>
                  </ul>
               </li>
               <li>
                  <a href="javascript:;">Hãng sản xuất<span class="arrdown"></span></a>
                  <ul class="dropfilter tcolum">
                  <?php
                  $list_cat1 = db_array('SELECT cat_name,cat_alias FROM categories WHERE cat_type = "products" LIMIT 0,5');
                  $list_cat2 = db_array('SELECT cat_name,cat_alias FROM categories WHERE cat_type = "products" LIMIT 5,5');
                  ?>
                     <li class="nofloat"><a<?=$_GET['catalias'] == '' ? ' class="checked"' : ''?> href="/may-tinh-bang/">Tất cả</a></li>
                     <li>
                     <?php
                     foreach($list_cat1 as $cat) {
                        ?>
                        <a<?=($_GET['catalias'] == $cat['cat_alias']) ? ' class="checked"' : ''?> href="/may-tinh-bang-<?=$cat['cat_alias']?>/"><?=$cat['cat_name']?></a>
                        <?
                     }
                     ?>
                     </li>
                     <li>
                     <?php
                     foreach($list_cat2 as $cat) {
                        ?>
                        <a<?=($_GET['catalias'] == $cat['cat_alias']) ? ' class="checked"' : ''?> href="/dien-thoai-<?=$cat['cat_alias']?>/"><?=$cat['cat_name']?></a>
                        <?
                     }
                     ?>
                     </li>
                  </ul>
               </li>
               <li>
                  <a href="javascript:;">Hệ điều hành<span class="arrdown"></span></a>
                  <ul class="dropfilter">
                     <li>
                        <a<?=$filter_os == '' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price?><?=$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Tất cả</a>
                        <a<?=$filter_os == 'android' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os?>hdh=android<?=$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Android</a>
                        <a<?=$filter_os == 'ios' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os?>hdh=ios<?=$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">iOS (iPhone)</a>
                        <a<?=$filter_os == 'windows' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os?>hdh=windows<?=$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Windows Phone</a>
                        <a<?=$filter_os == 'other' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os?>hdh=other<?=$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Hệ điều hành khác</a>
                     </li>
                  </ul>
               </li>
               <li><a href="javascript:;">Màn hình<span class="arrdown"></span></a>
                  <ul class="dropfilter">
                     <li>
                        <a<?=$filter_display == '' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os?><?=$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Tất cả</a>
                        <a<?=$filter_display == 'duoi-3' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display?>man=duoi-3<?=$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Dưới 3"</a>
                        <a<?=$filter_display == 'khoang-3' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display?>man=khoang-3<?=$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Khoảng 3"</a>
                        <a<?=$filter_display == 'khoang-4' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display?>man=khoang-4<?=$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Khoảng 4"</a>
                        <a<?=$filter_display == 'khoang-5' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display?>man=khoang-5<?=$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Khoảng 5"</a>
                        <a<?=$filter_display == 'khoang-6' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display?>man=khoang-6<?=$tt_feature.$current_filter_feature.$tt_view.$current_filter_view?>">Khoảng 6"</a>
                     </li>
                  </ul>
               </li>
               <li>
                  <a href="javascript:;">Tính năng<span class="arrdown"></span></a>
                  <ul class="dropfilter">
                     <li>
                        <a<?=$filter_feature == '' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display?><?=$tt_view.$current_filter_view?>">Tất cả</a>
                        <a<?=$filter_feature == 'bang-tan-3g-4g' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature?>tn=bang-tan-3g-4g<?=$tt_view.$current_filter_view?>">Băng tần 3G, 4G</a>
                        <a<?=$filter_feature == '2-sim-2-song' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature?>tn=2-sim-2-song<?=$tt_view.$current_filter_view?>">2 Sim 2 Sóng</a>
                        <a<?=$filter_feature == 'smartphone' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature?>tn=smartphone<?=$tt_view.$current_filter_view?>">SmartPhone</a>
                        <a<?=$filter_feature == 'wifi' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature?>tn=wifi<?=$tt_view.$current_filter_view?>">Wifi</a>
                        <a<?=$filter_feature == 'cam-ung' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature?>tn=cam-ung<?=$tt_view.$current_filter_view?>">Cảm ứng</a>
                     </li>
                  </ul>
               </li>
            
               <li class="last-li"><a href="javascript:;">Sắp xếp hiển thị theo<span class="arrdown"></span></a>
                  <ul class="dropfilter">
                     <li>
                        <a<?=$filter_view == 'xem-nhieu-nhat' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view?>sx=xem-nhieu-nhat">Xem nhiều nhất</a>
                        <a<?=$filter_view == 'gia-cao-den-thap' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view?>sx=gia-cao-den-thap">Giá cao đến thấp</a>
                        <a<?=$filter_view == 'gia-thap-den-cao' ? ' class="checked"' : ''?> href="<?=$current_url?>?<?=$current_filter_price.$tt_os.$current_filter_os.$tt_display.$current_filter_display.$tt_feature.$current_filter_feature.$tt_view?>sx=gia-thap-den-cao">Giá thấp đến cao</a>
                     </li>
                  </ul>
               </li>
            </ul>
         </div><!-- filter_wrap -->
         <ul class="categorypromote">
            <li>
               <a href="#" target="_blank">iPhone 6 Plus</a>
            </li>
            <li>
               <a href="#" target="_blank">iPhone 6</a>
            </li>
            <li>
               <a href="#" target="_blank">Galaxy Note 4</a>
            </li>
            <li>
               <a href="#" target="_blank">Xperia Z3</a>
            </li>
            <li>
               <a href="#" target="_blank">Galaxy Note Edge</a>
            </li>
         </ul>
         <div class="anybanner">
            <a href="" target="_blank"><img src="http://cdn.tgdd.vn/qcao/09_10_2014_16_14_40_smartphone-hot-1.jpg" alt="" width="1170" height="120"/></a>
         </div>
         <?
         if($_GET['catalias'] == ''){
            echo '<h1 style="font-size: 16px; padding: 10px 0px 5px 0px; clear: both;">Máy tính bảng</h1>';
         }else {
            echo '<h1 style="font-size: 16px; padding: 10px 0px 5px 0px; clear: both;">Máy tính bảng '.$curr_cat['cat_name'].'</h1>';
         }
         ?>
         <div class="products_list">
         <?php
         $arr_os = array('android'=>'Android','ios'=>'IOS (iPhone)','windows'=>'Windows Phone','other'=>'HĐH khác');
         $list_instock_status = array(0=>'Hết hàng',1=>'Còn hàng',2=>'Sắp về',3=>'Sắp ra mắt');
         foreach($list_products as $product) {
            ?>
            <div class="proitem">
               <?=$product['pro_promotion'] != '' ? '<span class="tagmotion">Khuyến mãi</span>' : ''?>
               <a href="<?=url_product_detail($product)?>">
                  <img src="<?=img_link($product['pro_image'],'small')?>" alt="<?=$product['pro_name']?>" />
                  <p class="goods"><?=$list_instock_status[$product['pro_instock_status']]?></p>
                  <h3 class="name"><?=$product['pro_name']?></h3>
                  <h4 class="price"><?=format_price($product['pro_price'])?></h4>
                  <?=$product['pro_promotion'] != '' ? '<p class="motion">Khuyến mãi lớn</p>' : ''?>
                  <div class="info">
                     <span>Màn hình: <?=$product['pro_display_standard']?>, <?=$product['pro_display_width']?> inches</span>
                     <span>HĐH: <?=$arr_os[$product['pro_general_os']]?></span>
                     <span>CPU: <?=$product['pro_cpuram_core']?>, <?=$product['pro_cpuram_speed']?>, RAM <?=$product['pro_cpuram_ram']?></span>
                     <span>Camera: <?=$product['pro_cam_primary']?>, <?=$product['pro_connect_duasim']?></span>
                     <span>Dung lượng pin: <?=$product['pro_pin_capacity']?></span>
                  </div>
               </a>
            </div>
            <?
         }
         ?>
         </div>
         <?php
         if($total_products == 0) {
            echo '<h3>Không có sản phẩm nào được tìm thấy !</h3>';
         }elseif($total_products > 20) {
            ?>
            <button class="btnmorelist" onclick="LoadMoreProductCat()">Mời bạn xem tiếp (còn 119 điện thoại di động)</button>
            <?php
         }
         ?>
      </div><!-- products_wrap -->
   </div>
</div>